<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" template="ui.xhtml">

	<ui:define name="head">
		<style type="text/css">
.ui-confirm-dialog-severity {
	margin: 0 7px 7px 0;
}
</style>
	</ui:define>
	<ui:define name="content">
		<p:panel header="#{msg.link_typefile}" id="panel">
			<p:growl showDetail="true" />
			<h:form enctype="multipart/form-data">
				<p:fileUpload
					fileUploadListener="#{FileUploadController.handleFileUpload}"
					label="#{msg.label_choosefile}" cancelLabel="#{msg.label_cancel}"
					uploadLabel="#{msg.label_uploadfile}" mode="advanced"
					update=":frmTypeFile" sizeLimit="100000"
					allowTypes="/(\.|\/)(gif|jpe?g|png)$/" />
			</h:form>
			<br />
			<h:form id="frmTypeFile" prependId="false" method="get">
				<p:dataTable var="typeList" paginator="true" rows="10"
					paginatorPosition="bottom"
					paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
					rowsPerPageTemplate="1,5,10,15,20,30"
					value="#{FileUploadController.listTypeFile}">
					<h:inputHidden value="#{typeList.id}" />
					<p:column headerText="#{msg.label_name}">
						<h:outputText value="#{typeList.name}" />
					</p:column>
					<p:column headerText="#{msg.label_route}">
						<h:outputText value="#{typeList.rute}" />
					</p:column>
					<p:column headerText="#{msg.label_extension}">
						<p:graphicImage alt="image" value="#{ImageTypeBean.imageType}"
							width="30" height="30" cache="false">
							<f:param name="type_id" value="#{typeList.id}" />
						</p:graphicImage>
					</p:column>
					<p:column style="width:12%; text-align: center;">
						<p:commandButton icon="delete" title="#{msg.label_delete}"
							onclick="confirmation.show()"
							actionListener="#{FileUploadController.prepareFile(typeList.id)}" />
					</p:column>
				</p:dataTable>
			</h:form>
			<!-- Formulario para borrar -->
			<h:form prependId="false">
				<p:confirmDialog id="confirmDialog"
					message="#{msg.label_confirmationdltper}" header="Borrar perfil"
					severity="alert" widgetVar="confirmation">
					<p:commandButton id="confirm" update=":frmTypeFile :panel"
						value="#{msg.label_yes}" oncomplete="confirmation.hide()"
						actionListener="#{FileUploadController.delete()}" icon="accept" />
					<p:commandButton id="decline" value="#{msg.label_no}"
						onclick="confirmation.hide()" type="button" icon="cancel" />
				</p:confirmDialog>
			</h:form>
		</p:panel>
	</ui:define>
</ui:composition>